package cn.neusoft.config;

import cn.neusoft.xmldi.UserController;
import cn.neusoft.xmldi.UserDao;
import cn.neusoft.xmldi.UserService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration //配置类
public class AppConfig {
	@Bean
	public UserDao userDao( ) {
		return new UserDao();
	}

	@Bean
	public UserService userService() {
		UserService userService=new UserService();
		userService.setUserDao(userDao());
		return userService;
	}
     @Bean
	public UserController userController() {
		UserController userController=new UserController();
		userController.setUserService(userService());
		return userController;
	}
}
